import request from '@/utils/request'

// 查询所有教务科目列表
export function allSubject() {
  return request({
    url: '/subject/subject/all',
    method: 'get',
    params: {}
  })
}

// 查询教务科目列表
export function listSubject(query) {
  return request({
    url: '/subject/subject/list',
    method: 'get',
    params: query
  })
}

// 查询教务科目详细
export function getSubject(id) {
  return request({
    url: '/subject/subject/' + id,
    method: 'get'
  })
}

// 新增教务科目
export function addSubject(data) {
  return request({
    url: '/subject/subject',
    method: 'post',
    data: data
  })
}

// 修改教务科目
export function updateSubject(data) {
  return request({
    url: '/subject/subject',
    method: 'put',
    data: data
  })
}

// 删除教务科目
export function delSubject(id) {
  return request({
    url: '/subject/subject/' + id,
    method: 'delete'
  })
}

// 更换教务科目方向
export function directionSubject(id1, id2, direction) {
  return request({
    url: '/subject/subject/' + id1 + '/' + id2 + '/'+ direction,
    method: 'get'
  })
}